\(\int \cot (c+d x) (a+b \sec (c+d x)) \, dx\) [260]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 43 \[ \int \cot (c+d x) (a+b \sec (c+d x)) \, dx=\frac {(a+b) \log (1-\cos (c+d x))}{2 d}+\frac {(a-b) \log (1+\cos (c+d x))}{2 d} \]

[Out]

1/2*(a+b)*ln(1-cos(d*x+c))/d+1/2*(a-b)*ln(1+cos(d*x+c))/d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3968, 2747, 647, 31} \[ \int \cot (c+d x) (a+b \sec (c+d x)) \, dx=\frac {(a+b) \log (1-\cos (c+d x))}{2 d}+\frac {(a-b) \log (\cos (c+d x)+1)}{2 d} \]

[In]

Int[Cot[c + d*x]*(a + b*Sec[c + d*x]),x]

[Out]

((a + b)*Log[1 - Cos[c + d*x]])/(2*d) + ((a - b)*Log[1 + Cos[c + d*x]])/(2*d)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 647

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[(-a)*c, 2]}, Dist[e/2 + c*(d/(2*q)),
Int[1/(-q + c*x), x], x] + Dist[e/2 - c*(d/(2*q)), Int[1/(q + c*x), x], x]] /; FreeQ[{a, c, d, e}, x] && NiceS
qrtQ[(-a)*c]

Rule 2747

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 3968

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))/cot[(c_.) + (d_.)*(x_)], x_Symbol] :> Int[(b + a*Sin[c + d*x])/Cos[
c + d*x], x] /; FreeQ[{a, b, c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int (b+a \cos (c+d x)) \csc (c+d x) \, dx \\ & = -\frac {a \text {Subst}\left (\int \frac {b+x}{a^2-x^2} \, dx,x,a \cos (c+d x)\right )}{d} \\ & = -\frac {(a-b) \text {Subst}\left (\int \frac {1}{-a-x} \, dx,x,a \cos (c+d x)\right )}{2 d}-\frac {(a+b) \text {Subst}\left (\int \frac {1}{a-x} \, dx,x,a \cos (c+d x)\right )}{2 d} \\ & = \frac {(a+b) \log (1-\cos (c+d x))}{2 d}+\frac {(a-b) \log (1+\cos (c+d x))}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.49 \[ \int \cot (c+d x) (a+b \sec (c+d x)) \, dx=-\frac {b \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {a \log (\cos (c+d x))}{d}+\frac {b \log \left (\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {a \log (\tan (c+d x))}{d} \]

[In]

Integrate[Cot[c + d*x]*(a + b*Sec[c + d*x]),x]

[Out]

-((b*Log[Cos[c/2 + (d*x)/2]])/d) + (a*Log[Cos[c + d*x]])/d + (b*Log[Sin[c/2 + (d*x)/2]])/d + (a*Log[Tan[c + d*
x]])/d

Maple [A] (verified)

Time = 0.47 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.77

method result size
derivativedivides \(\frac {a \ln \left (\sin \left (d x +c \right )\right )+b \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )}{d}\) \(33\)
default \(\frac {a \ln \left (\sin \left (d x +c \right )\right )+b \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )}{d}\) \(33\)
risch \(-i a x -\frac {2 i a c}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b}{d}\) \(84\)

[In]

int(cot(d*x+c)*(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*ln(sin(d*x+c))+b*ln(-cot(d*x+c)+csc(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.88 \[ \int \cot (c+d x) (a+b \sec (c+d x)) \, dx=\frac {{\left (a - b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a + b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, d} \]

[In]

integrate(cot(d*x+c)*(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/2*((a - b)*log(1/2*cos(d*x + c) + 1/2) + (a + b)*log(-1/2*cos(d*x + c) + 1/2))/d

Sympy [F]

\[ \int \cot (c+d x) (a+b \sec (c+d x)) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right ) \cot {\left (c + d x \right )}\, dx \]

[In]

integrate(cot(d*x+c)*(a+b*sec(d*x+c)),x)

[Out]

Integral((a + b*sec(c + d*x))*cot(c + d*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.79 \[ \int \cot (c+d x) (a+b \sec (c+d x)) \, dx=\frac {{\left (a - b\right )} \log \left (\cos \left (d x + c\right ) + 1\right ) + {\left (a + b\right )} \log \left (\cos \left (d x + c\right ) - 1\right )}{2 \, d} \]

[In]

integrate(cot(d*x+c)*(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/2*((a - b)*log(cos(d*x + c) + 1) + (a + b)*log(cos(d*x + c) - 1))/d

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.42 \[ \int \cot (c+d x) (a+b \sec (c+d x)) \, dx=\frac {{\left (a + b\right )} \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - 2 \, a \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right )}{2 \, d} \]

[In]

integrate(cot(d*x+c)*(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

1/2*((a + b)*log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1)) - 2*a*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c)
 + 1) + 1)))/d

Mupad [B] (verification not implemented)

Time = 14.48 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.19 \[ \int \cot (c+d x) (a+b \sec (c+d x)) \, dx=\frac {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d}+\frac {b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

[In]

int(cot(c + d*x)*(a + b/cos(c + d*x)),x)

[Out]

(a*log(tan(c/2 + (d*x)/2)))/d - (a*log(tan(c/2 + (d*x)/2)^2 + 1))/d + (b*log(tan(c/2 + (d*x)/2)))/d